import { RouteRecordRaw } from 'vue-router'

export const constRoute: RouteRecordRaw[] = [
  {
    path: '/',
    component: () => import('@/layout/index.vue'),
    meta: {
      title: '',
      hidden: false,
      icon: ''
    },
    redirect: '/home',
    children: [
      {
        path: '/home',
        component: () => import('@/views/home/home.vue'),
        meta: {
          title: '首页',
          hidden: false,
          icon: 'House'
        }
      }
    ]
  },
  {
    name: 'login',
    path: '/login',
    component: () => import('@/views/login/login.vue'),
    meta: {
      title: '登录',
      hidden: true
    }
  },

  // 一级路由
  {
    name: 'Screen',
    path: '/screen',
    component: () => import('@/views/screen/screen.vue'),
    meta: {
      hidden: false,
      title: '数据大屏'
    }
  },
  // 二级路由
  {
    name: 'Acl',
    path: '/acl',
    component: () => import('@/layout/index.vue'),
    redirect: '/acl/user',
    meta: {
      title: '权限管理',
      hidden: false
    },
    children: [
      {
        path: '/acl/user',
        name: 'User',
        component: () => import('@/views/acl/user/user.vue'),
        meta: {
          title: '用户管理',
          hidden: false,
          icon: 'User'
        }
      },
      {
        path: '/acl/role',
        name: 'Role',
        component: () => import('@/views/acl/role/role.vue'),
        meta: {
          title: '角色管理',
          hidden: false,
          icon: 'User'
        }
      },
      {
        path: '/acl/permission',
        name: 'Permission',
        component: () => import('@/views/acl/permission/permission.vue'),
        meta: {
          title: '菜单管理',
          hidden: false,
          icon: 'User'
        }
      }
    ]
  },
  {
    path: '/product',
    name: 'Product',
    component: () => import('@/layout/index.vue'),
    redirect: '/product/trademark',
    meta: {
      title: '商品管理',
      hidden: false,
      icon: ''
    },
    children: [
      {
        path: '/product/trademark',
        name: 'Trademark',
        component: () => import('@/views/product/trademark/trademark.vue'),
        meta: {
          title: '品牌管理',
          hidden: false
        }
      },
      {
        path: '/product/attr',
        name: 'Attr',
        component: () => import('@/views/product/attr/attr.vue'),
        meta: {
          title: '属性管理',
          hidden: false
        }
      },
      {
        path: '/product/spu',
        name: 'Spu',
        component: () => import('@/views/product/spu/spu.vue'),
        meta: {
          title: 'spu管理',
          hidden: false
        }
      },
      {
        path: '/product/sku',
        name: 'Sku',
        component: () => import('@/views/product/sku/sku.vue'),
        meta: {
          title: 'sku管理',
          hidden: false
        }
      }
    ]
  },
  {
    name: 'notfound',
    path: '/:pathMatch(.*)',
    component: () => import('../views/not-found/not-found.vue'),
    meta: {
      title: '404',
      hidden: true
    }
  }
]
